<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        color: blue;
      }
    </style>
  </head>
  <body>
    <script>
      document.write("<pre>")
      for (var i = 1; i <= 21; i++) {
        for (var t = 1; t <= Math.abs(11 - i); t++) {
          document.write(" ")
        }
        for (var j = 1; j <= 21 - 2 * Math.abs(11 - i); j++) {
          if (j == 1 || j == 21 - 2 * Math.abs(11 - i)) {
            document.write("*")
          } else {
            document.write(" ")
          }
        }

        document.write("<br>")
      }
    </script>
  </body>
</html>
